
<template>
  <suspense>
    <template #default>
      <div v-resize="resize">
        <Demo3Child msg="父组件1"></Demo3Child>
        <Child ref="Child"></Child>
      </div>
    </template>
    <template #fallback>
      <div>
        Loading...
      </div>
    </template>
  </suspense>
</template>
<script lang="ts">
import Demo3Child from '@/components/Demo3Child.vue'
import Child from '@/components/expose.vue'
export default {
  components: {
    Demo3Child,
    Child
  },
  onMounted () {
    document.addEventListener('visibilitychange', () => {
      if (!document.hidden) {
        console.log('处于当前页面')
      } else {
        console.log('不在当前页面')
      }
    })
  },
  methods: {
    resize ():void {
      console.log('resize')
    }
  }
}
</script>
<style lang="less" scoped>

</style>
